<?php

class Constant_Form_Constant_Insert extends Zend_Form
{

	public function __construct(Zend_Controller_Action $controller)
	{
		$constant_code = $this->createElement ( 'text', 'constant_code' )->setLabel ( 'Mã hằng số' )->setRequired(true);
		
		$constant_name = $this->createElement ( 'text', 'constant_name' )->setLabel ( 'Tên hằng số' );
		
		$constant_note = $this->createElement ( 'textarea', 'constant_note' )->setLabel ( 'Ghi chú' );
		
		$constant_content = $this->createElement ( 'textarea', 'constant_content' )->setLabel ( 'Nội dung' )->setAttrib ( "class", "editor Full" );
		
		$constant_display_type = $this->createElement ( 'radio', 'constant_display_type' )->setLabel ( 'Tùy chọn hiển thị' )->setValue ( 0 )->setMultiOptions ( Zend_Registry::get ( 'constant' )->constant_display_type->toArray () )->setRequired(true);
		
		$constant_display_regexp = $this->createElement ( 'text', 'constant_display_regexp' )->setLabel ( 'Điều kiện hiển thị' );
		
		$this->addElements ( array ($constant_code, $constant_name, $constant_note, $constant_content, $constant_display_type, $constant_display_regexp, $constant_code) );
		
		$controller->getHelper ( 'common' )->form ( $this );
	}
}
